-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support react forget by config #12396
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough此次更新增加了 Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Size Change: +1.19 kB (+0.01%) Total Size: 9.9 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!pnpm-lock.yaml
Files selected for processing (4)
- docs/docs/docs/api/config.md (1 hunks)
- packages/preset-umi/package.json (1 hunks)
- packages/preset-umi/src/features/forget/forget.ts (1 hunks)
- packages/preset-umi/src/index.ts (1 hunks)
Files skipped from review due to trivial changes (2)
- packages/preset-umi/package.json
- packages/preset-umi/src/index.ts
Additional Context Used
LanguageTool (5)
docs/docs/docs/api/config.md (5)
Near line 234: 您不可用“是”来表达个形容词。大部分人都平常用“很”来代替“是”。您是不是想表达"很大"?
Context: ...` 提供 code splitting 的策略方案。 bigVendors 是大 vendors 方案,会将 async chunk 里的 node_modul...
Near line 238: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:好"地"利用
Context: ...dors 和 depPerChunk 之间取了中间值,同时又能在缓存效率上有更好的利用。无特殊场景,建议用 granularChunks 策略。 ## conv...
Near line 852: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:常见"地"使用
Context: ...include: ['fa:home', 'local:icon']
。常见的使用场景:将 icon 字符串定义在一个 map 中,导致无法检测到;在 `md...
Near line 950: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:准"地"转换
Context: ...的转换,此时你可以通过配置
extraBabelIncludes` 更精准的转换那些有兼容性问题的包。 - 因低版本浏览器不支持 Top level aw...
Near line 1023: 动词的修饰一般为‘形容词(副词)+地+动词’。您的意思是否是:则"地"依赖
Context: ...lude: [ /vant/ ] }只要
import` 路径中匹配该正则的依赖都不走 MFSU 处理 示例, ```js // 用 esbuild 做...
Additional comments not posted (5)
packages/preset-umi/src/features/forget/forget.ts (5)
1-1
: 导入IApi
模块没有问题。
3-14
:api.describe
块定义了forget
功能的配置架构,并设置了启用条件。使用zod
进行验证,配置通过存在的配置键启用。
16-27
:api.onCheckConfig
块检查与mfsu
和mako
的兼容性。如果启用了mfsu
或mako
,代码会抛出错误,确保兼容性。
29-36
:api.onCheck
块检查 React 版本以确保其为 19 或更高版本。代码正确地分割版本字符串并比较主版本号。
38-47
:api.modifyConfig
块修改项目配置以添加 React 编译器的 Babel 插件。代码将现有的 Babel 插件与新插件及其配置合并。
...memo, | ||
extraBabelPlugins: [ | ||
...(memo.extraBabelPlugins || []), | ||
[require.resolve('babel-plugin-react-compiler'), ReactCompilerConfig], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
由于 babel-plugin-react-compiler
还是试验阶段的库,所以可能每天或者经常都被发布更新,可能存在很多 bug ,在不断的修复和发布过程中,很快 umi 仓库内锁定的这个依赖的版本就会陈旧,所以应该优先读一下用户自己安装的 babel-plugin-react-compiler
,如果用户没安装再用内置的。
配置开启,
Summary by CodeRabbit
新功能
forget
配置选项,用于 React 编译器功能。babel-plugin-react-compiler
依赖。文档
config.md
文档,包含forget
配置选项的详细信息及兼容性注意事项。